#include<bits/stdc++.h>
using namespace std;
bool issu(int num){
	if(num<=1) return false;
	for(int i = 2;i <= sqrt(num);i++){
		if(num%i==0) return false;
	}
	return true;
}
int main(){
	int num;
	cin >> num; 
	if(issu(num) && issu(num-6)) cout << "Yes\n" << num-6;
	else if(issu(num) && issu(num+6)) cout << "Yes\n" << num+6;
	else{
		cout << "No\n";
		while(!(issu(num) && (issu(num+6) || issu(num-6)))){
			num++;
		}
		cout << num;
	}
	return 0;
}
